
exports.index = function(req, res){
 
  console.log("routes/logs/index");
  var mongoose = require('mongoose');
  var FULog = mongoose.model('FULog');
  var nPerPage = req.query.limit;

 FULog.count().exec( 
 
   function (err, c) {
      if (err) 
        return handleError(err);
   
      var count = c;
      FULog.find().skip((req.query.page-1)*nPerPage).limit(nPerPage).exec(
        function (err, fulog) {
        if (err) 
          return handleError(err);
        var data = { 'totalCount': count, 'data':fulog };
        res.json(data);     
        }
      );
    }
  );


};

